package com.ruoyi.web.controller.system;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.domain.vo.NoticeIdReq;
import com.ruoyi.system.domain.vo.OrgApplyDTO;
import com.ruoyi.system.mapper.SysNoticeMapper;
import com.ruoyi.system.service.ISysDictTypeService;
import com.ruoyi.system.service.ISysNoticeService;
import com.ruoyi.web.controller.aop.WebLog;
import com.ruoyi.web.controller.enums.NoticeTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;

/**
 * 公告 信息操作处理
 * 
 * @author ruoyi
 */
@RestController
@Api(tags = "首页报表模块")
@RequestMapping("/org/apply")
public class OrgApplyController extends BaseController
{
    @Autowired
    private ISysDictTypeService dictTypeService;
    @Autowired
    private ISys

    @GetMapping(value = "quarter")
    @ApiOperation("获取当前季度")
    @WebLog(description = "获取当前季度")
    public AjaxResult quarter()
    {
        List<SysDictData> resultList = dictTypeService.selectDictDataByType("org_apply_quarter");
        if(CollUtil.isNotEmpty(resultList)){
            return success(resultList.get(0).getDictValue());
        }
        LocalDate currentDate = LocalDate.now();
        int month = currentDate.getMonthValue();
        int quarter = (month - 1) / 3 + 1;
        return success(quarter);
    }

    @PostMapping(value = "save")
    @ApiOperation("提交数据")
    public AjaxResult applySave(@RequestBody OrgApplyDTO orgApplyDTO)
    {

        return success(null);
    }



}
